package cc.telecomdigital.tdstock.utils;

public class Index implements BMPEntityBase
{
	/*
	 * 恆生指數，國企指數，紅籌，創業，金融，公用，地產，工商
	 */
	static final public String[]	TypeName			= { "HSI", "HSCEI", "HSCCI", "GEM", "HSI-FIN", "HSI-UTL", "HSI-PRO", "HSI-CnI" };
	static final public String		TypeName_Str_Tab0	= "HSI,HSCEI";
	static final public String		TypeName_Str_Tab1	= "HSI,HSCEI,HSCCI,GEM,HSI-FIN,HSI-UTL,HSI-PRO,HSI-CnI";

	static final public String		NAME				= "NAME";

	static final public String		LAST				= "LAST";
	static final public String		NET					= "NET";
	static final public String		NETPERCENTAGE		= "NETPERCENTAGE";
	static final public String		HIGH				= "HIGH";
	static final public String		LOW					= "LOW";
	static final public String		OPEN				= "OPEN";
	static final public String		VOL					= "VOL";
	static final public String		PREV				= "PREV";

	static final public String[]	FIELD_ITEMS			= { NAME, LAST, NET, HIGH, LOW, OPEN, PREV, VOL };
	static final public String[]	FIELD_ITEMS_STOCK	= { NAME, LAST, NET, PREV, VOL };
	static final public String[]	FIELD_ITEMS_MONITOR	= { NAME, LAST, NET, PREV };

	private String					name;
	private String					last;
	private String					net;
//	private String					netPercentage;
	private String					high;
	private String					low;
	private String					open;
	private String					vol;
	private String					prev;
	
	@Override
	public String toString()
	{
		return name+","+last+","+net+","+high+","+low+","+open+","+vol+","+prev;
	}

	@Override
	public void SetValueByFIELDS_STOCK(int i, String value)
	{
		switch (i)
		{
			case 0:
				setName(value);
				break;
			case 1:
				setLast(value);
				break;
			case 2:
				setNet(value);
				break;
			case 3:
				setPrev(value);
				break;
			case 4:
				setVol(value);
				break;
		}
	}

	@Override
	public void SetValueByFIELDS_MONITOR(int i, String value)
	{
		switch (i)
		{
			case 0:
				setName(value);
				break;
			case 1:
				setLast(value);
				break;
			case 2:
				setNet(value);
				break;
			case 3:
				setPrev(value);
				break;
		}
	}
	
	@Override
	public void SetValueByFIELDS(int i, String value)
	{
		switch (i)
		{
			case 0:
				setName(value);
				break;
			case 1:
				setLast(value);
				break;
			case 2:
				setNet(value);
				break;
			case 3:
				setHigh(value);
				break;
			case 4:
				setLow(value);
				break;
			case 5:
				setOpen(value);
				break;
			case 6:
				setPrev(value);
				break;
			case 7:
				setVol(value);
				break;
		}
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getLast()
	{
		return last;
	}

	public void setLast(String last)
	{
		this.last = last;
	}

	public String getNet()
	{
		return net;
	}

	public void setNet(String net)
	{
		this.net = net;
	}

//	public String getNetPercentage()
//	{
//		return netPercentage;
//	}
//
//	public void setNetPercentage(String netPercentage)
//	{
//		this.netPercentage = netPercentage;
//	}

	public String getHigh()
	{
		return high;
	}

	public void setHigh(String high)
	{
		this.high = high;
	}

	public String getLow()
	{
		return low;
	}

	public void setLow(String low)
	{
		this.low = low;
	}

	public String getOpen()
	{
		return open;
	}

	public void setOpen(String open)
	{
		this.open = open;
	}

	public String getVol()
	{
		return vol;
	}

	public void setVol(String vol)
	{
		this.vol = vol;
	}

	public String getPrev()
	{
		return prev;
	}

	public void setPrev(String prev)
	{
		this.prev = prev;
	}

	@Override
	public void SetValueByFIELDS_COP(int index, String value)
	{
	}

	@Override
	public void SetValueByFIELDS_NET(int index, String value)
	{
	}

	@Override
	public void SetValueByFIELDS_TURNOVER(int index, String value)
	{
	}
	
	@Override
	public String GetKey()
	{
		return name;
	}

	@Override
	public void SetKeyValue(String value)
	{
		name = value;
	}
}
